package cn.iocoder.yudao.module.ai.dal.mysql.algorithmlibrary;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.algorithmlibrary.AlgorithmLibraryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.algorithm.vo.*;

/**
 * 推理算法库 Mapper
 *
 * @author gt
 */
@Mapper
public interface AlgorithmLibraryMapper extends BaseMapperX<AlgorithmLibraryDO> {

    default PageResult<AlgorithmLibraryDO> selectPage(AlgorithmLibraryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AlgorithmLibraryDO>()
                .likeIfPresent(AlgorithmLibraryDO::getAlgorithmName, reqVO.getAlgorithmName())
                .eqIfPresent(AlgorithmLibraryDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(AlgorithmLibraryDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(AlgorithmLibraryDO::getSize, reqVO.getSize())
                .eqIfPresent(AlgorithmLibraryDO::getSuplierId, reqVO.getSuplierId())
                .likeIfPresent(AlgorithmLibraryDO::getAlgorithmChineseName, reqVO.getAlgorithmChineseName())
                .likeIfPresent(AlgorithmLibraryDO::getAlgorithmEnglishName, reqVO.getAlgorithmEnglishName())
                .eqIfPresent(AlgorithmLibraryDO::getHardware, reqVO.getHardware())
                .eqIfPresent(AlgorithmLibraryDO::getFrameDetection, reqVO.getFrameDetection())
                .eqIfPresent(AlgorithmLibraryDO::getDockerRun, reqVO.getDockerRun())
                .eqIfPresent(AlgorithmLibraryDO::getAlgorithmType, reqVO.getAlgorithmType())
                .eqIfPresent(AlgorithmLibraryDO::getBelongModelType, reqVO.getBelongModelType())
                .eqIfPresent(AlgorithmLibraryDO::getRunningCmd, reqVO.getRunningCmd())
                .eqIfPresent(AlgorithmLibraryDO::getRunBuild, reqVO.getRunBuild())
                .eqIfPresent(AlgorithmLibraryDO::getDockerBuild, reqVO.getDockerBuild())
                .eqIfPresent(AlgorithmLibraryDO::getJsonPath, reqVO.getJsonPath())
                .eqIfPresent(AlgorithmLibraryDO::getImagePath, reqVO.getImagePath())
                .eqIfPresent(AlgorithmLibraryDO::getGpuCard, reqVO.getGpuCard())
                .eqIfPresent(AlgorithmLibraryDO::getModelPath, reqVO.getModelPath())
                .eqIfPresent(AlgorithmLibraryDO::getAlgorithmCreateType, reqVO.getAlgorithmCreateType())
                .orderByDesc(AlgorithmLibraryDO::getId));
    }

}